package pers.lipeng.gobang;

import javax.swing.*;
import java.awt.*;

/**
 * @author APengG
 */
public class FlagFactory {
    public static boolean current_flag_white = true;
    private static Flag flag = new Flag(0,0, Color.WHITE);

    public static Flag createFlag(int x,int y){
        Flag clone = flag.clone();
        clone.setBodyX(x);
        clone.setBodyY(y);
        if(current_flag_white) {
            clone.setColor(Color.WHITE);
        }else {
            clone.setColor(Color.BLACK);
        }
        current_flag_white = !current_flag_white;

        return clone;
    }

}
